'use strict'

import HybridJS from '../core/core'

const $ = HybridJS

/**
 * 微信分享网页链接
 * @param {*} obj {type:"session/timeline",url:"",title:"",description:"",icon:"",callback:function(success[true/false])}
 */
function link(obj) {
    $.callNative("wxshare","link",obj)
}

/**
 * 微信分享图片
 * @param {*} obj {"type":type,"url":url,"callback":fn} type(session:好友，timeline:朋友圈)
 */
function img(obj) {
    $.callNative("wxshare","img",obj)
}

/**
 * 微信分享文字
 * @param {*} obj {"type":type,"text":text,"callback":fn}
 */
function text(obj) {
    $.callNative("wxshare","text",obj)
}

export default {
    link,
    img,
    text
}